<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../core/include.inc.jsp"%>

<form id="pagerForm" method="post" action="fix_list">
    <input type="hidden" name="pageNum" value="${pageModel.pageNum}" />
    <input type="hidden" name="numPerPage" value="${pageModel.numPerPage}" />
    <input type="hidden" name="worker" value="${fixInfo.worker}" />
</form>

<form onsubmit="return navTabSearch(this);" action="fix_list" method="post">
    <div class="pageHeader">
        <div class="searchBar">
            <ul class="searchContent">
                <li>
                    <label>处理人姓名：</label>
                    <input type="text" name="worker" value="${fixInfo.worker}" class="textInput" />
                </li>
                <li>
                    <label>状态：</label>
                    <select class="combox" name="status">
                        <option value="">全部状态：</option>
                        <option value="已处理" <c:if test="${fixInfo.status == '已处理'}">selected</c:if>>已处理</option>
                        <option value="未处理" <c:if test="${fixInfo.status == '未处理'}">selected</c:if>>未处理</option>
                    </select>
                </li>
            </ul>
            <div class="subBar">
                <ul>
                    <li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="pageContent">
        <div class="panelBar">
            <ul class="toolBar">
                <li><a style="display: none;" class="edit fix-edit" href="to_fix_edit?id={item_id}" target="dialog" rel="to_fix_edit"
                       width="600" height="400" mask="true"><span>处理</span></a></li>
                <li><a class="edit" onclick="checkFixReply()"><span>回复</span></a></li>
                <li class="line">line</li>
                <li><a class="delete" href="fix_delect?id={item_id}" target="ajaxTodo" title="确定要删除吗?">
                    <span>删除</span></a></li>
                <li class="line">line</li>
            </ul>
        </div>
        <table class="table" width="100%" layoutH="137" style="table-layout: fixed">
            <thead>
            <tr>
                <th>序号</th>
                <th>物业/社区名称</th>
                <th>小区名称</th>
                <th>姓名</th>
                <th>详细地址</th>
                <th>联系电话</th>
                <th>报修内容</th>
                <th>状态</th>
                <th>处理人</th>
                <th>处理人电话</th>
                <th>区域类型</th>
                <th>图片</th>
                <th>创建时间</th>
            </tr>
            </thead>
            <tbody class="fix-tb-body">
            <c:forEach var="item" items="${list}" varStatus="st">
                <tr target="item_id" rel="${item.id}" ondblclick="tableclick()" conStatus="${item.status}">
                    <td>${st.index+1}</td>
                    <td>${workNo}</td>
                    <td>${item.blockName}</td>
                    <td>${item.name}</td>
                    <td>${item.addr}</td>
                    <td>${item.phone}</td>
                    <td><div STYLE="text-overflow:ellipsis;white-space:nowrap;overflow: hidden;">${item.content}</div></td>
                    <td>${item.status}</td>
                    <td>${item.worker}</td>
                    <td>${item.workerTel}</td>
                    <td>${item.areeType}</td>
                    <td>
                        <c:if test="${item.imgs[0]!=''}">
                            <a href="${item.imgs[0]}" target="navTab">点击查看</a>
                        </c:if>
                    </td>
                    <%--<td><img STYLE="width: 30px" src="${item.imgs[0]}"></td>--%>
                    <td>
                        <fmt:formatDate value="${item.createTime}" pattern="yyyy-MM-dd"/>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>

        <c:import url="../core/pagebar.inc.jsp" />

    </div>
</form>

<script>
   function checkFixReply() {
       var m = "";
       $(".fix-tb-body").find("tr").each(function(i,j){
           if( $(j).hasClass( "selected" ) ){
               m += "1";
               if( $(j).attr("conStatus") == '已处理' ){
                   alertMsg.info('您已经回复过了！');
                   return;
               }
               $(".fix-edit").click();
               return;
           }
       })
       if( m == ""  ){
           alertMsg.info('请选择一条记录！');
       }
   }
</script>
   }
</script>
